package com.ttc.group2.videochat.utils;

import android.content.Context;
import android.content.SharedPreferences;

public class Preferences {

	private static final String PREF_NAME = "_pref_video_chat";
	private static final String USERNAME = "_user_name";
	
	private SharedPreferences getSettings(Context context) {
		return context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
	}
	
	public void setUserName(Context context, String userName) {
		SharedPreferences.Editor editor = getSettings(context).edit();
		editor.putString(USERNAME, userName);
		editor.commit();
	}
	
	public String getUserName(Context context) {
		return getSettings(context).getString(USERNAME, null);
	}
	
}
